/**
 * There are automatic code generation
 */
package ${packageName}.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import ${packageName}.entity.${ClassName};
import ${packageName}.dao.${ClassName}Dao;
import ${packageName}.service.${ClassName}Service;

/**
 * ${functionName}ServiceImpl
 * @author ${classAuthor}
 * @version ${classVersion}
 */
@Service("${className}Service")
public class ${ClassName}ServiceImpl implements ${ClassName}Service {
    
    @Autowired
    private ${ClassName}Dao ${className}Dao;

     /**
     * 功能描述: 通过主键删除
     *
     * @param record 主键id包含的实体类
     * @see [相关类/方法](可选)
     * @since [产品/模块版本](可选)
     */
    @Override
    public Boolean delete${ClassName}ById(${ClassName} record) {
        int iRet = ${className}Dao.deleteByPrimaryKey(record.getId());
        if (iRet > 0) 
        {
            return true;
        }
        return false;
    }


     /**
     * 功能描述: 新增插入表
     *
     * @param record 表对应实体类
     * @see [相关类/方法](可选)
     * @since [产品/模块版本](可选)
     */
    @Override
    public Boolean add${ClassName}(${ClassName} record) {
        int iRet = ${className}Dao.insertSelective(record);
        if (iRet > 0) 
        {
            return true;
        }
        return false;
    }
    
    
     /**
     * 功能描述:通过主键id查询对象
     *
     * @param record 主键id包含的实体类
     * @see [相关类/方法](可选)
     * @since [产品/模块版本](可选)
     */
    @Override
    public ${ClassName} query${ClassName}ById(${ClassName} record) {
        return ${className}Dao.selectByPrimaryKey(record.getId());
    }


     /**
     * 功能描述: 表对应实体类
     *
     * @param record 表对应实体类
     * @see [相关类/方法](可选)
     * @since [产品/模块版本](可选)
     */
    @Override
    public Boolean modify${ClassName}ById(${ClassName} record) {
        int iRet = ${className}Dao.updateByPrimaryKeySelective(record);
        if (iRet > 0) 
        {
            return true;
        }
        return false;
    }
}
